package pjwstk.jps.result;

import pjwstk.jps.datastore.OID;
import pjwstk.jps.datastore.*;

/**
 * @author s9111_s10304
 *
 */
public class ReferenceResult extends SingleResult implements IReferenceResult
{
    private OID oidValue;
    private ISBAObject value;
    
    public ReferenceResult(OID aValue) {
        oidValue = aValue;
    }
    
    public static ReferenceResult createFromSBAObject(ISBAObject o) {
		ReferenceResult refObj = new ReferenceResult(o.getOID());
		refObj.setValue(o);
		
		return refObj;
	}
    
    public void setValue(ISBAObject aValue) {
    	value = aValue;
    }

    @Override
    public OID getOIDValue() {
        return oidValue;
    }
    
    @Override
    public String toString() {
        return "ref(" + value.toString() + ")";
    }
}